﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Robot: Robot Class Reference</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                Examples using state machines generated by StateBuilderCpp
            </h1>
            <h3>
                Robot: Robot Class Reference
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-slots">Public Slots</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-slots">Private Slots</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">Robot Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Robot" -->
<p><code>#include &lt;<a class="el" href="_robot_8h_source.html">Robot.h</a>&gt;</code></p>

<p><a href="class_robot-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-slots"></a>
Public Slots</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_robot.html#aa9557020db442f60170b50388b752eff">start</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_robot.html#a14dfe126ae973d3b9f81fee81a06ac22">stop</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_robot.html#a4fc7c70ae20623f05e06f2ecb388b6c4">Robot</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_robot.html#a924320124b09c2f2ac1621aa210d5f38">~Robot</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-slots"></a>
Private Slots</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_robot.html#aa252cc9c30bff243dbdf91000a058093">contextEnd</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_robot.html#ab9803f802028f1a85760dc3fee009a85">logInit</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">RobotContext *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">m_pRobotContext</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_arm.html">Arm</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_robot.html#afa88703da4121d95dad2cfc33758a9b0">m_pArm</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_camera.html">Camera</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_robot.html#a55d0bf3d1e013f274b1fe4354e0de8a7">m_pCamera</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="_robot_8h_source.html#l00011">11</a> of file <a class="el" href="_robot_8h_source.html">Robot.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a4fc7c70ae20623f05e06f2ecb388b6c4"></a><!-- doxytag: member="Robot::Robot" ref="a4fc7c70ae20623f05e06f2ecb388b6c4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Robot::Robot </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_robot_8cpp_source.html#l00020">20</a> of file <a class="el" href="_robot_8cpp_source.html">Robot.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
    <a class="code" href="class_robot.html#afa88703da4121d95dad2cfc33758a9b0">m_pArm</a> = <span class="keyword">new</span> <a class="code" href="class_arm.html">Arm</a>();
    <a class="code" href="class_robot.html#a55d0bf3d1e013f274b1fe4354e0de8a7">m_pCamera</a> = <span class="keyword">new</span> <a class="code" href="class_camera.html">Camera</a>();

    <a class="code" href="class_robot.html#ab9803f802028f1a85760dc3fee009a85">logInit</a>();
    <span class="comment">// Generated RobotContext</span>
    <a class="code" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">m_pRobotContext</a> = <span class="keyword">new</span> RobotContext(*<a class="code" href="class_robot.html#a55d0bf3d1e013f274b1fe4354e0de8a7">m_pCamera</a>, *<a class="code" href="class_robot.html#afa88703da4121d95dad2cfc33758a9b0">m_pArm</a>);
    <a class="code" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">m_pRobotContext</a>-&gt;SetObserver(SmQtObserver::GetInstance());
    QObject::connect(<a class="code" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">m_pRobotContext</a>,
                     SIGNAL(end()),
                     <span class="keyword">this</span>,
                     SLOT(<a class="code" href="class_robot.html#aa252cc9c30bff243dbdf91000a058093">contextEnd</a>()));

    QObject::connect(<a class="code" href="class_robot.html#afa88703da4121d95dad2cfc33758a9b0">m_pArm</a>,
                     SIGNAL(calibrationDone()),
                     <a class="code" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">m_pRobotContext</a>,
                     SLOT(evArmCalibrationDone()));

    QObject::connect(<a class="code" href="class_robot.html#a55d0bf3d1e013f274b1fe4354e0de8a7">m_pCamera</a>,
                     SIGNAL(calibrationDone()),
                     <a class="code" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">m_pRobotContext</a>,
                     SLOT(evCameraCalibrationDone()));

}
</pre></div>
</div>
</div>
<a class="anchor" id="a924320124b09c2f2ac1621aa210d5f38"></a><!-- doxytag: member="Robot::~Robot" ref="a924320124b09c2f2ac1621aa210d5f38" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Robot::~Robot </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_robot_8cpp_source.html#l00046">46</a> of file <a class="el" href="_robot_8cpp_source.html">Robot.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
    QLOG_DEBUG();
    <span class="keyword">delete</span> <a class="code" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">m_pRobotContext</a>;
    <span class="keyword">delete</span> <a class="code" href="class_robot.html#afa88703da4121d95dad2cfc33758a9b0">m_pArm</a>;
    <span class="keyword">delete</span> <a class="code" href="class_robot.html#a55d0bf3d1e013f274b1fe4354e0de8a7">m_pCamera</a>;
}
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa252cc9c30bff243dbdf91000a058093"></a><!-- doxytag: member="Robot::contextEnd" ref="aa252cc9c30bff243dbdf91000a058093" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Robot::contextEnd </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private, slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_robot_8cpp_source.html#l00069">69</a> of file <a class="el" href="_robot_8cpp_source.html">Robot.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
    QCoreApplication::exit(0);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ab9803f802028f1a85760dc3fee009a85"></a><!-- doxytag: member="Robot::logInit" ref="ab9803f802028f1a85760dc3fee009a85" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Robot::logInit </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_robot_8cpp_source.html#l00054">54</a> of file <a class="el" href="_robot_8cpp_source.html">Robot.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
   QCoreApplication *pApp = QCoreApplication::instance();
   QsLogging::Logger&amp; logger = QsLogging::Logger::instance();
   logger.setLoggingLevel(QsLogging::TraceLevel);
   <span class="comment">//Log to file</span>
   <span class="keyword">const</span> QString logPath(QDir(pApp-&gt;applicationDirPath()).filePath(<span class="stringliteral">&quot;Log.txt&quot;</span>));
   QsLogging::DestinationPtr fileDestination(
      QsLogging::DestinationFactory::MakeFileDestination(logPath) );
   logger.addDestination(fileDestination);
   <span class="comment">//Log to standard output</span>
   QsLogging::DestinationPtr debugDestination = QsLogging::DestinationFactory::MakeDebugOutputDestination();
   logger.addDestination(debugDestination);
}
</pre></div>
</div>
</div>
<a class="anchor" id="aa9557020db442f60170b50388b752eff"></a><!-- doxytag: member="Robot::start" ref="aa9557020db442f60170b50388b752eff" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Robot::start </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_robot_8cpp_source.html#l00074">74</a> of file <a class="el" href="_robot_8cpp_source.html">Robot.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
    QLOG_INFO();
    <a class="code" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">m_pRobotContext</a>-&gt;evCalibrateRequest();
}
</pre></div>
</div>
</div>
<a class="anchor" id="a14dfe126ae973d3b9f81fee81a06ac22"></a><!-- doxytag: member="Robot::stop" ref="a14dfe126ae973d3b9f81fee81a06ac22" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Robot::stop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_robot_8cpp_source.html#l00080">80</a> of file <a class="el" href="_robot_8cpp_source.html">Robot.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
    QLOG_INFO();
    <a class="code" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">m_pRobotContext</a>-&gt;evStop();
}
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="afa88703da4121d95dad2cfc33758a9b0"></a><!-- doxytag: member="Robot::m_pArm" ref="afa88703da4121d95dad2cfc33758a9b0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_arm.html">Arm</a>* <a class="el" href="class_robot.html#afa88703da4121d95dad2cfc33758a9b0">Robot::m_pArm</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_robot_8h_source.html#l00028">28</a> of file <a class="el" href="_robot_8h_source.html">Robot.h</a>.</p>

</div>
</div>
<a class="anchor" id="a55d0bf3d1e013f274b1fe4354e0de8a7"></a><!-- doxytag: member="Robot::m_pCamera" ref="a55d0bf3d1e013f274b1fe4354e0de8a7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_camera.html">Camera</a>* <a class="el" href="class_robot.html#a55d0bf3d1e013f274b1fe4354e0de8a7">Robot::m_pCamera</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_robot_8h_source.html#l00029">29</a> of file <a class="el" href="_robot_8h_source.html">Robot.h</a>.</p>

</div>
</div>
<a class="anchor" id="a6077a98499fd5a4164b4cb83c5ac514a"></a><!-- doxytag: member="Robot::m_pRobotContext" ref="a6077a98499fd5a4164b4cb83c5ac514a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">RobotContext* <a class="el" href="class_robot.html#a6077a98499fd5a4164b4cb83c5ac514a">Robot::m_pRobotContext</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_robot_8h_source.html#l00027">27</a> of file <a class="el" href="_robot_8h_source.html">Robot.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_robot_8h_source.html">Robot.h</a></li>
<li><a class="el" href="_robot_8cpp_source.html">Robot.cpp</a></li>
</ul>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
